#!/bin/bash
# you need export vars in your .bashrc before runing this
# see setenv.sh
#export JAVA_HOME="/usr/lib/jvm/java-6-sun"
#export GRIDGAIN_HOME="/home/pierrick/GC3D/gridgain-2.1.1"
#export POV_BIN="/home/pierrick/GC3D/megapov-1.2.1/megapov"
# var only for the server (for the video building)
export FTP_HOME="/home/pierrick/GC3D/apache-ftpserver-1.0.0/res/home"
export MENC_BIN="/usr/bin/mencoder"

workspace="/home/pierrick/GC3D"

echo 'Do you want to run FTP? (Y/n)'
read RESPFTP
echo 'Do you want to run Tomcat6? (Y/n)'
read RESPTOMCAT
echo 'Do you want to run eclipse? (y/N)'
read RESPECLIPSE
echo 'Do you want to run Gridgain? [new window] (y/N)'
read RESPGG

if [[ $RESPFTP == 'n' || $RESPFTP == 'N' ]]; then
    echo 'No.'
else
    $workspace/apache-ftpserver-1.0.0/bin/ftpd.sh res/conf/ftpd-typical.xml &
fi
if [[ $RESPTOMCAT == 'n' || $RESPTOMCAT == 'N' ]]; then
    echo 'No.'
else
    $workspace/apache-tomcat-6.0.18/bin/catalina.sh run &
fi
if [[ $RESPECLIPSE == 'y' || $RESPECLIPSE == 'Y' ]]; then
    $workspace/eclipse/eclipse &
else
    echo 'No.'
fi
if [[ $RESPGG == 'y' || $RESPGG == 'Y' ]]; then
    gnome-terminal -x $GRIDGAIN_HOME/bin/gridgain.sh
else
    echo 'No.'
fi

echo "Fin."
echo "Ctrl+C to quit"
cat

